#!/bin/sh


count=1
number=$1
VARx=$2
VARr=$3
VAR1=$4
VAR2=$5
VAR3=$6
VAR4=$7
VAR5=$8
VAR6=$9
VAR7=${10}
VAR8=${11}
VAR0=${12}
VARa=${13}
VARb=${14}
VARc=${15}
VARd=${16}
VARe=${17}
VARf=${18}
VARg=${19}
VARh=${20}
VARi=${21}
VARj=${22}
DOI=${23}
ROC=${24}
RO1C=${25}
RWC=${26}
RW1C=${27}
WMC=${28}
WM1C=${29}
ECRC=${30}
ECR1C=${31}
VCTT=${32}
VBK=${33}

if [ $count -eq $number ] ; then
exit
fi


while true; do

VARx=$((VARx+1))
VARr=$((VARr+1))
VAR4=$((VAR4+1))
VAR8=$((VAR8+1))

echo >>/tmp/device.conf.tmp
echo "Drive: "$VARx" CHANNEL: "$VAR2" TARGET: $VAR3 LUN: "$VAR4 >>/tmp/device.conf.tmp
echo " Library ID: "$VAR1" Slot: "$VARr >>/tmp/device.conf.tmp
echo " Vendor identification: "$VAR5 >>/tmp/device.conf.tmp
echo " Product identification: "$VAR6 >>/tmp/device.conf.tmp
echo " Product revision level: "$VAR7 >>/tmp/device.conf.tmp
echo " Unit serial number: "$VAR8 >>/tmp/device.conf.tmp
echo " NAA: $VAR1:11:22:33:ab:$VAR2:$VAR3:$VAR4" >>/tmp/device.conf.tmp
echo " Compression: factor $VARb enabled $VARa" >>/tmp/device.conf.tmp
echo " Compression type: "$VCTT >>/tmp/device.conf.tmp
if [ $VBK != "Default" ] ; then echo " Backoff:" $VBK  >>/tmp/device.conf.tmp; else echo " Backoff:" 400  >>/tmp/device.conf.tmp; fi

if [ "$DOI" = "yes" ]&&[ "$ROC" = "yes" ] ; then
echo " READ_ONLY: "$VARc >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$RO1C" = "yes" ] ; then
echo " READ_ONLY: "$VARd >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$RWC" = "yes" ] ; then
echo " READ_WRITE: "$VARe >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$RW1C" = "yes" ] ; then
echo " READ_WRITE: "$VARf >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$WMC" = "yes" ] ; then
echo " WORM: "$VARg >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$WM1C" = "yes" ] ; then
echo " WORM: "$VARh >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$ECRC" = "yes" ] ; then
echo " ENCRYPTION: "$VARi >>/tmp/device.conf.tmp
fi
if [ "$DOI" = "yes" ]&& [ "$ECR1C" = "yes" ] ; then
echo " ENCRYPTION: "$VARj >>/tmp/device.conf.tmp
fi

count=$((count+1))
if [ $count -eq $number ] ; then
exit
fi

done
